<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>if&show</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
  <div id="div">
    <!--相对路径容易找到-->
    <img v-if="flag" src="img/1.jpg">
    <img v-show="flag" src="img/2.jpg">
  </div>
</body>
  <script>
    new Vue({
      el: "#div",
      data: {
        //true可查看到图片资源
        //false不可查看到资源
        flag : true
        //flag : false
      }
    })

  </script>
</html>